import request from '@/utils/request'

// 查询合同变更列表
export function listHtbg(query) {
  return request({
    url: '/htbg/htbg/list',
    method: 'get',
    params: query
  })
}

// 查询合同变更详细
export function getHtbg(htbgId) {
  return request({
    url: '/htbg/htbg/' + htbgId,
    method: 'get'
  })
}

// 获取合同编制与课题承担人员详细信息
export function selectHtglHtbgZcryByHtbgId(htbgId) {
  return request({
    url: '/htbg/htbg/zcry/' + htbgId,
    method: 'get'
  })
}

// 新增合同变更
export function addHtbg(data) {
  return request({
    url: '/htbg/htbg',
    method: 'post',
    data: data
  })
}

// 修改合同变更
export function updateHtbg(data) {
  return request({
    url: '/htbg/htbg',
    method: 'put',
    data: data
  })
}

// 删除合同变更
export function delHtbg(htbgId) {
  return request({
    url: '/htbg/htbg/' + htbgId,
    method: 'delete'
  })
}

// 获取合同变更主键ID
export function getHtBgId() {
  return request({
    url: '/htbg/htbg/getHtBgId',
    method: 'get'
  })
}

// 新增附件
export function insertHtbgFjByHtbgId(data) {
  return request({
    url: '/htbg/htbg/add/File/By/subId',
    method: 'post',
    data: data
  })
}

// 根据主表ID查询附件列表
export function selectHtbgFjList(htbgId) {
  return request({
    url: '/htbg/htbg/get/FileList/By/subId?sId=' + htbgId,
    method: 'get'
  })
}

// 根据模板导出word
export function exportHtBgWord(query, htbgId) {
  return request({
    url: '/htbg/htbg/exportWord/' + htbgId,
    method: 'get',
    params: query
  })
}

// 删除合同变更附件
export function delHtBgFj(fjId) {
  return request({
    url: '/htbg/htbg/fj/' + fjId,
    method: 'delete'
  })
}
